.class public Lcom/htc/android/footprints/view/PlayButton;
.super Landroid/widget/ImageView;
.source "PlayButton.java"

# interfaces
.implements Landroid/view/View$OnClickListener;
.implements Landroid/media/MediaPlayer$OnCompletionListener;
.implements Landroid/media/MediaPlayer$OnErrorListener;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/htc/android/footprints/view/PlayButton$OnCheckedChangeListener;,
        Lcom/htc/android/footprints/view/PlayButton$OnStateChangedListener;
    }
.end annotation


# static fields
.field public static final IDLE_STATE:I = 0x0

.field public static final INTERNAL_ERROR:I = 0x2

.field public static final NO_ERROR:I = 0x0

.field public static final PAUSE_STATE:I = 0x2

.field public static final PLAYING_STATE:I = 0x1

.field public static final SDCARD_ACCESS_ERROR:I = 0x1

.field private static final TAG:Ljava/lang/String; = "PlayButton"


# instance fields
.field private mFootprint:Lcom/htc/android/footprints/vo/Footprint;

.field mOnStateChangedListener:Lcom/htc/android/footprints/view/PlayButton$OnStateChangedListener;

.field private mPlayer:Landroid/media/MediaPlayer;

.field mSampleFile:Ljava/io/File;

.field public mSampleLength:I

.field mSampleStart:J

.field mState:I


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 4
    .parameter "context"

    .prologue
    const/4 v3, 0x0

    const/4 v2, 0x0

    .line 78
    invoke-direct {p0, p1}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    .line 31
    iput v3, p0, Lcom/htc/android/footprints/view/PlayButton;->mState:I

    .line 41
    iput-object v2, p0, Lcom/htc/android/footprints/view/PlayButton;->mPlayer:Landroid/media/MediaPlayer;

    .line 44
    const-wide/16 v0, 0x0

    iput-wide v0, p0, Lcom/htc/android/footprints/view/PlayButton;->mSampleStart:J

    .line 47
    iput v3, p0, Lcom/htc/android/footprints/view/PlayButton;->mSampleLength:I

    .line 49
    iput-object v2, p0, Lcom/htc/android/footprints/view/PlayButton;->mSampleFile:Ljava/io/File;

    .line 51
    iput-object v2, p0, Lcom/htc/android/footprints/view/PlayButton;->mOnStateChangedListener:Lcom/htc/android/footprints/view/PlayButton$OnStateChangedListener;

    .line 79
    invoke-direct {p0}, Lcom/htc/android/footprints/view/PlayButton;->initView()V

    .line 80
    invoke-direct {p0}, Lcom/htc/android/footprints/view/PlayButton;->initFunction()V

    .line 81
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;II)V
    .locals 4
    .parameter "context"
    .parameter "width"
    .parameter "height"

    .prologue
    const/4 v3, 0x0

    const/4 v2, 0x0

    .line 84
    invoke-direct {p0, p1}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    .line 31
    iput v3, p0, Lcom/htc/android/footprints/view/PlayButton;->mState:I

    .line 41
    iput-object v2, p0, Lcom/htc/android/footprints/view/PlayButton;->mPlayer:Landroid/media/MediaPlayer;

    .line 44
    const-wide/16 v0, 0x0

    iput-wide v0, p0, Lcom/htc/android/footprints/view/PlayButton;->mSampleStart:J

    .line 47
    iput v3, p0, Lcom/htc/android/footprints/view/PlayButton;->mSampleLength:I

    .line 49
    iput-object v2, p0, Lcom/htc/android/footprints/view/PlayButton;->mSampleFile:Ljava/io/File;

    .line 51
    iput-object v2, p0, Lcom/htc/android/footprints/view/PlayButton;->mOnStateChangedListener:Lcom/htc/android/footprints/view/PlayButton$OnStateChangedListener;

    .line 86
    invoke-direct {p0}, Lcom/htc/android/footprints/view/PlayButton;->initView()V

    .line 87
    invoke-direct {p0}, Lcom/htc/android/footprints/view/PlayButton;->initFunction()V

    .line 88
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 4
    .parameter "context"
    .parameter "attrs"

    .prologue
    const/4 v3, 0x0

    const/4 v2, 0x0

    .line 91
    invoke-direct {p0, p1, p2, v2}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 31
    iput v2, p0, Lcom/htc/android/footprints/view/PlayButton;->mState:I

    .line 41
    iput-object v3, p0, Lcom/htc/android/footprints/view/PlayButton;->mPlayer:Landroid/media/MediaPlayer;

    .line 44
    const-wide/16 v0, 0x0

    iput-wide v0, p0, Lcom/htc/android/footprints/view/PlayButton;->mSampleStart:J

    .line 47
    iput v2, p0, Lcom/htc/android/footprints/view/PlayButton;->mSampleLength:I

    .line 49
    iput-object v3, p0, Lcom/htc/android/footprints/view/PlayButton;->mSampleFile:Ljava/io/File;

    .line 51
    iput-object v3, p0, Lcom/htc/android/footprints/view/PlayButton;->mOnStateChangedListener:Lcom/htc/android/footprints/view/PlayButton$OnStateChangedListener;

    .line 92
    invoke-direct {p0}, Lcom/htc/android/footprints/view/PlayButton;->initView()V

    .line 93
    invoke-direct {p0}, Lcom/htc/android/footprints/view/PlayButton;->initFunction()V

    .line 94
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 4
    .parameter "context"
    .parameter "attrs"
    .parameter "defStyle"

    .prologue
    const/4 v3, 0x0

    const/4 v2, 0x0

    .line 97
    invoke-direct {p0, p1, p2, p3}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 31
    iput v3, p0, Lcom/htc/android/footprints/view/PlayButton;->mState:I

    .line 41
    iput-object v2, p0, Lcom/htc/android/footprints/view/PlayButton;->mPlayer:Landroid/media/MediaPlayer;

    .line 44
    const-wide/16 v0, 0x0

    iput-wide v0, p0, Lcom/htc/android/footprints/view/PlayButton;->mSampleStart:J

    .line 47
    iput v3, p0, Lcom/htc/android/footprints/view/PlayButton;->mSampleLength:I

    .line 49
    iput-object v2, p0, Lcom/htc/android/footprints/view/PlayButton;->mSampleFile:Ljava/io/File;

    .line 51
    iput-object v2, p0, Lcom/htc/android/footprints/view/PlayButton;->mOnStateChangedListener:Lcom/htc/android/footprints/view/PlayButton$OnStateChangedListener;

    .line 98
    invoke-direct {p0}, Lcom/htc/android/footprints/view/PlayButton;->initView()V

    .line 99
    invoke-direct {p0}, Lcom/htc/android/footprints/view/PlayButton;->initFunction()V

    .line 100
    return-void
.end method

.method private controlKeepScreenOn(I)V
    .locals 2
    .parameter "state"

    .prologue
    const/16 v1, 0x80

    .line 215
    packed-switch p1, :pswitch_data_0

    .line 224
    .end local p0
    :goto_0
    return-void

    .line 217
    .restart local p0
    :pswitch_0
    invoke-virtual {p0}, Lcom/htc/android/footprints/view/PlayButton;->getContext()Landroid/content/Context;

    move-result-object p0

    .end local p0
    check-cast p0, Landroid/app/Activity;

    invoke-virtual {p0}, Landroid/app/Activity;->getWindow()Landroid/view/Window;

    move-result-object v0

    invoke-virtual {v0, v1}, Landroid/view/Window;->clearFlags(I)V

    goto :goto_0

    .line 221
    .restart local p0
    :pswitch_1
    invoke-virtual {p0}, Lcom/htc/android/footprints/view/PlayButton;->getContext()Landroid/content/Context;

    move-result-object p0

    .end local p0
    check-cast p0, Landroid/app/Activity;

    invoke-virtual {p0}, Landroid/app/Activity;->getWindow()Landroid/view/Window;

    move-result-object v0

    invoke-virtual {v0, v1}, Landroid/view/Window;->addFlags(I)V

    goto :goto_0

    .line 215
    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_1
        :pswitch_1
    .end packed-switch
.end method

.method private initFunction()V
    .locals 0

    .prologue
    .line 103
    return-void
.end method

.method private initView()V
    .locals 1

    .prologue
    .line 106
    const v0, 0x7f02003a

    invoke-virtual {p0, v0}, Lcom/htc/android/footprints/view/PlayButton;->setBackgroundResource(I)V

    .line 107
    sget-object v0, Landroid/widget/ImageView$ScaleType;->CENTER:Landroid/widget/ImageView$ScaleType;

    invoke-virtual {p0, v0}, Lcom/htc/android/footprints/view/PlayButton;->setScaleType(Landroid/widget/ImageView$ScaleType;)V

    .line 108
    iget v0, p0, Lcom/htc/android/footprints/view/PlayButton;->mState:I

    invoke-direct {p0, v0}, Lcom/htc/android/footprints/view/PlayButton;->setIcon(I)V

    .line 109
    invoke-virtual {p0, p0}, Lcom/htc/android/footprints/view/PlayButton;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 110
    return-void
.end method

.method private setError(I)V
    .locals 1
    .parameter "error"

    .prologue
    .line 232
    iget-object v0, p0, Lcom/htc/android/footprints/view/PlayButton;->mOnStateChangedListener:Lcom/htc/android/footprints/view/PlayButton$OnStateChangedListener;

    if-eqz v0, :cond_0

    .line 233
    iget-object v0, p0, Lcom/htc/android/footprints/view/PlayButton;->mOnStateChangedListener:Lcom/htc/android/footprints/view/PlayButton$OnStateChangedListener;

    invoke-interface {v0, p1}, Lcom/htc/android/footprints/view/PlayButton$OnStateChangedListener;->onError(I)V

    .line 234
    :cond_0
    return-void
.end method

.method private setIcon(I)V
    .locals 1
    .parameter "state"

    .prologue
    const v0, 0x7f0200d6

    .line 113
    packed-switch p1, :pswitch_data_0

    .line 126
    :goto_0
    return-void

    .line 115
    :pswitch_0
    invoke-virtual {p0, v0}, Lcom/htc/android/footprints/view/PlayButton;->setImageResource(I)V

    goto :goto_0

    .line 118
    :pswitch_1
    invoke-virtual {p0, v0}, Lcom/htc/android/footprints/view/PlayButton;->setImageResource(I)V

    goto :goto_0

    .line 121
    :pswitch_2
    const v0, 0x7f0200d3

    invoke-virtual {p0, v0}, Lcom/htc/android/footprints/view/PlayButton;->setImageResource(I)V

    goto :goto_0

    .line 113
    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_2
        :pswitch_1
    .end packed-switch
.end method

.method private setState(I)V
    .locals 1
    .parameter "state"

    .prologue
    .line 205
    iget v0, p0, Lcom/htc/android/footprints/view/PlayButton;->mState:I

    if-ne p1, v0, :cond_0

    .line 212
    :goto_0
    return-void

    .line 208
    :cond_0
    iput p1, p0, Lcom/htc/android/footprints/view/PlayButton;->mState:I

    .line 209
    iget v0, p0, Lcom/htc/android/footprints/view/PlayButton;->mState:I

    invoke-direct {p0, v0}, Lcom/htc/android/footprints/view/PlayButton;->setIcon(I)V

    .line 210
    iget v0, p0, Lcom/htc/android/footprints/view/PlayButton;->mState:I

    invoke-direct {p0, v0}, Lcom/htc/android/footprints/view/PlayButton;->signalStateChanged(I)V

    .line 211
    iget v0, p0, Lcom/htc/android/footprints/view/PlayButton;->mState:I

    invoke-direct {p0, v0}, Lcom/htc/android/footprints/view/PlayButton;->controlKeepScreenOn(I)V

    goto :goto_0
.end method

.method private showToast(Ljava/lang/String;)V
    .locals 2
    .parameter "showmsg"

    .prologue
    .line 237
    if-eqz p1, :cond_0

    .line 238
    invoke-virtual {p0}, Lcom/htc/android/footprints/view/PlayButton;->getContext()Landroid/content/Context;

    move-result-object v0

    const/16 v1, 0x7d0

    invoke-static {v0, p1, v1}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/Toast;->show()V

    .line 240
    :cond_0
    return-void
.end method

.method private signalStateChanged(I)V
    .locals 1
    .parameter "state"

    .prologue
    .line 227
    iget-object v0, p0, Lcom/htc/android/footprints/view/PlayButton;->mOnStateChangedListener:Lcom/htc/android/footprints/view/PlayButton$OnStateChangedListener;

    if-eqz v0, :cond_0

    .line 228
    iget-object v0, p0, Lcom/htc/android/footprints/view/PlayButton;->mOnStateChangedListener:Lcom/htc/android/footprints/view/PlayButton$OnStateChangedListener;

    invoke-interface {v0, p1}, Lcom/htc/android/footprints/view/PlayButton$OnStateChangedListener;->onStateChanged(I)V

    .line 229
    :cond_0
    return-void
.end method

.method private startPlayback()V
    .locals 5

    .prologue
    const/4 v4, 0x0

    const/4 v3, 0x1

    .line 147
    invoke-virtual {p0}, Lcom/htc/android/footprints/view/PlayButton;->stopPlayback()V

    .line 149
    new-instance v1, Landroid/media/MediaPlayer;

    invoke-direct {v1}, Landroid/media/MediaPlayer;-><init>()V

    iput-object v1, p0, Lcom/htc/android/footprints/view/PlayButton;->mPlayer:Landroid/media/MediaPlayer;

    .line 150
    iget-object v1, p0, Lcom/htc/android/footprints/view/PlayButton;->mSampleFile:Ljava/io/File;

    if-nez v1, :cond_0

    .line 170
    :goto_0
    return-void

    .line 153
    :cond_0
    :try_start_0
    iget-object v1, p0, Lcom/htc/android/footprints/view/PlayButton;->mPlayer:Landroid/media/MediaPlayer;

    iget-object v2, p0, Lcom/htc/android/footprints/view/PlayButton;->mSampleFile:Ljava/io/File;

    invoke-virtual {v2}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/media/MediaPlayer;->setDataSource(Ljava/lang/String;)V

    .line 154
    iget-object v1, p0, Lcom/htc/android/footprints/view/PlayButton;->mPlayer:Landroid/media/MediaPlayer;

    invoke-virtual {v1, p0}, Landroid/media/MediaPlayer;->setOnCompletionListener(Landroid/media/MediaPlayer$OnCompletionListener;)V

    .line 155
    iget-object v1, p0, Lcom/htc/android/footprints/view/PlayButton;->mPlayer:Landroid/media/MediaPlayer;

    invoke-virtual {v1, p0}, Landroid/media/MediaPlayer;->setOnErrorListener(Landroid/media/MediaPlayer$OnErrorListener;)V

    .line 156
    iget-object v1, p0, Lcom/htc/android/footprints/view/PlayButton;->mPlayer:Landroid/media/MediaPlayer;

    invoke-virtual {v1}, Landroid/media/MediaPlayer;->prepare()V

    .line 157
    iget-object v1, p0, Lcom/htc/android/footprints/view/PlayButton;->mPlayer:Landroid/media/MediaPlayer;

    invoke-virtual {v1}, Landroid/media/MediaPlayer;->start()V
    :try_end_0
    .catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1

    .line 168
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v1

    iput-wide v1, p0, Lcom/htc/android/footprints/view/PlayButton;->mSampleStart:J

    .line 169
    invoke-direct {p0, v3}, Lcom/htc/android/footprints/view/PlayButton;->setState(I)V

    goto :goto_0

    .line 158
    :catch_0
    move-exception v1

    move-object v0, v1

    .line 159
    .local v0, e:Ljava/lang/IllegalArgumentException;
    const/4 v1, 0x2

    invoke-direct {p0, v1}, Lcom/htc/android/footprints/view/PlayButton;->setError(I)V

    .line 160
    iput-object v4, p0, Lcom/htc/android/footprints/view/PlayButton;->mPlayer:Landroid/media/MediaPlayer;

    goto :goto_0

    .line 162
    .end local v0           #e:Ljava/lang/IllegalArgumentException;
    :catch_1
    move-exception v1

    move-object v0, v1

    .line 163
    .local v0, e:Ljava/io/IOException;
    invoke-direct {p0, v3}, Lcom/htc/android/footprints/view/PlayButton;->setError(I)V

    .line 164
    iput-object v4, p0, Lcom/htc/android/footprints/view/PlayButton;->mPlayer:Landroid/media/MediaPlayer;

    goto :goto_0
.end method

.method private togglePlayback()V
    .locals 2

    .prologue
    .line 173
    iget-object v1, p0, Lcom/htc/android/footprints/view/PlayButton;->mPlayer:Landroid/media/MediaPlayer;

    if-nez v1, :cond_1

    .line 190
    :cond_0
    :goto_0
    return-void

    .line 175
    :cond_1
    iget v1, p0, Lcom/htc/android/footprints/view/PlayButton;->mState:I

    if-eqz v1, :cond_0

    .line 178
    :try_start_0
    iget-object v1, p0, Lcom/htc/android/footprints/view/PlayButton;->mPlayer:Landroid/media/MediaPlayer;

    invoke-virtual {v1}, Landroid/media/MediaPlayer;->isPlaying()Z

    move-result v1

    if-eqz v1, :cond_2

    .line 179
    iget-object v1, p0, Lcom/htc/android/footprints/view/PlayButton;->mPlayer:Landroid/media/MediaPlayer;

    invoke-virtual {v1}, Landroid/media/MediaPlayer;->pause()V

    .line 180
    const/4 v1, 0x2

    invoke-direct {p0, v1}, Lcom/htc/android/footprints/view/PlayButton;->setState(I)V
    :try_end_0
    .catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 186
    :catch_0
    move-exception v1

    move-object v0, v1

    .line 187
    .local v0, e:Ljava/lang/IllegalStateException;
    invoke-virtual {v0}, Ljava/lang/IllegalStateException;->printStackTrace()V

    goto :goto_0

    .line 182
    .end local v0           #e:Ljava/lang/IllegalStateException;
    :cond_2
    :try_start_1
    iget-object v1, p0, Lcom/htc/android/footprints/view/PlayButton;->mPlayer:Landroid/media/MediaPlayer;

    invoke-virtual {v1}, Landroid/media/MediaPlayer;->start()V

    .line 184
    const/4 v1, 0x1

    invoke-direct {p0, v1}, Lcom/htc/android/footprints/view/PlayButton;->setState(I)V
    :try_end_1
    .catch Ljava/lang/IllegalStateException; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_0
.end method


# virtual methods
.method public onClick(Landroid/view/View;)V
    .locals 2
    .parameter "v"

    .prologue
    .line 244
    iget-object v0, p0, Lcom/htc/android/footprints/view/PlayButton;->mSampleFile:Ljava/io/File;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/htc/android/footprints/view/PlayButton;->mSampleFile:Ljava/io/File;

    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result v0

    if-nez v0, :cond_1

    .line 245
    :cond_0
    invoke-virtual {p0}, Lcom/htc/android/footprints/view/PlayButton;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v1, 0x7f0a0074

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-direct {p0, v0}, Lcom/htc/android/footprints/view/PlayButton;->showToast(Ljava/lang/String;)V

    .line 246
    :cond_1
    iget v0, p0, Lcom/htc/android/footprints/view/PlayButton;->mState:I

    if-nez v0, :cond_3

    .line 247
    invoke-direct {p0}, Lcom/htc/android/footprints/view/PlayButton;->startPlayback()V

    .line 253
    :cond_2
    :goto_0
    return-void

    .line 248
    :cond_3
    iget v0, p0, Lcom/htc/android/footprints/view/PlayButton;->mState:I

    const/4 v1, 0x2

    if-ne v0, v1, :cond_4

    .line 249
    invoke-direct {p0}, Lcom/htc/android/footprints/view/PlayButton;->togglePlayback()V

    goto :goto_0

    .line 250
    :cond_4
    iget v0, p0, Lcom/htc/android/footprints/view/PlayButton;->mState:I

    const/4 v1, 0x1

    if-ne v0, v1, :cond_2

    .line 251
    invoke-direct {p0}, Lcom/htc/android/footprints/view/PlayButton;->togglePlayback()V

    goto :goto_0
.end method

.method public onCompletion(Landroid/media/MediaPlayer;)V
    .locals 1
    .parameter "mp"

    .prologue
    .line 133
    invoke-virtual {p0}, Lcom/htc/android/footprints/view/PlayButton;->stopPlayback()V

    .line 134
    const v0, 0x7f0200d6

    invoke-virtual {p0, v0}, Lcom/htc/android/footprints/view/PlayButton;->setImageResource(I)V

    .line 135
    return-void
.end method

.method public onError(Landroid/media/MediaPlayer;II)Z
    .locals 1
    .parameter "mp"
    .parameter "what"
    .parameter "extra"

    .prologue
    .line 138
    invoke-direct {p0, p2}, Lcom/htc/android/footprints/view/PlayButton;->setError(I)V

    .line 139
    const v0, 0x7f0200d6

    invoke-virtual {p0, v0}, Lcom/htc/android/footprints/view/PlayButton;->setImageResource(I)V

    .line 140
    const/4 v0, 0x1

    return v0
.end method

.method public setOnStateChangedListener(Lcom/htc/android/footprints/view/PlayButton$OnStateChangedListener;)V
    .locals 0
    .parameter "listener"

    .prologue
    .line 60
    iput-object p1, p0, Lcom/htc/android/footprints/view/PlayButton;->mOnStateChangedListener:Lcom/htc/android/footprints/view/PlayButton$OnStateChangedListener;

    .line 61
    return-void
.end method

.method public setfootprintData(Lcom/htc/android/footprints/vo/Footprint;)V
    .locals 2
    .parameter "data"

    .prologue
    .line 64
    if-eqz p1, :cond_0

    .line 65
    iput-object p1, p0, Lcom/htc/android/footprints/view/PlayButton;->mFootprint:Lcom/htc/android/footprints/vo/Footprint;

    .line 66
    iget-object v0, p0, Lcom/htc/android/footprints/view/PlayButton;->mFootprint:Lcom/htc/android/footprints/vo/Footprint;

    invoke-static {v0}, Lcom/htc/android/footprints/utils/FootprintUtils;->checkAudioData(Lcom/htc/android/footprints/vo/Footprint;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 67
    new-instance v0, Ljava/io/File;

    iget-object v1, p0, Lcom/htc/android/footprints/view/PlayButton;->mFootprint:Lcom/htc/android/footprints/vo/Footprint;

    iget-object v1, v1, Lcom/htc/android/footprints/vo/Footprint;->mAudioPath:Ljava/lang/String;

    invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    iput-object v0, p0, Lcom/htc/android/footprints/view/PlayButton;->mSampleFile:Ljava/io/File;

    .line 68
    iget-object v0, p0, Lcom/htc/android/footprints/view/PlayButton;->mSampleFile:Ljava/io/File;

    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result v0

    if-nez v0, :cond_0

    .line 69
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/htc/android/footprints/view/PlayButton;->mSampleFile:Ljava/io/File;

    .line 75
    :cond_0
    return-void
.end method

.method public stopPlayback()V
    .locals 1

    .prologue
    .line 193
    iget-object v0, p0, Lcom/htc/android/footprints/view/PlayButton;->mPlayer:Landroid/media/MediaPlayer;

    if-nez v0, :cond_0

    .line 200
    :goto_0
    return-void

    .line 196
    :cond_0
    iget-object v0, p0, Lcom/htc/android/footprints/view/PlayButton;->mPlayer:Landroid/media/MediaPlayer;

    invoke-virtual {v0}, Landroid/media/MediaPlayer;->stop()V

    .line 197
    iget-object v0, p0, Lcom/htc/android/footprints/view/PlayButton;->mPlayer:Landroid/media/MediaPlayer;

    invoke-virtual {v0}, Landroid/media/MediaPlayer;->release()V

    .line 198
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/htc/android/footprints/view/PlayButton;->mPlayer:Landroid/media/MediaPlayer;

    .line 199
    const/4 v0, 0x0

    invoke-direct {p0, v0}, Lcom/htc/android/footprints/view/PlayButton;->setState(I)V

    goto :goto_0
.end method
